home *** CD-ROM | disk | FTP | other *** search
/ Growing Good Roses / Growing Good Roses.iso / pc / misc / demo.dxr / 00018_mainMenu.ls < prev    next >
Encoding:
Text File  |  1997-04-18  |  2.4 KB  |  101 lines

  1. on exitFrame
  2.   global gGoingToTopic
  3.   if gGoingToTopic <> 1 then
  4.     go(the frame)
  5.   else
  6.     set gGoingToTopic to 0
  7.   end if
  8. end
  9.  
  10. on enterFrame
  11.   global gGoingToTopic
  12.   puppetSound(0)
  13.   cursor(-1)
  14.   setCursors()
  15.   puppetSprite(2, 1)
  16.   setPuppets(1)
  17.   set gGoingToTopic to 0
  18.   checkHilite()
  19. end
  20.  
  21. on checkHilite
  22.   global gTopicList, gButtonLast, gButtonBase
  23.   set vCast to the mouseCast
  24.   if vCast = -1 then
  25.     set vText to field "currentTitle"
  26.     if vText <> EMPTY then
  27.       put EMPTY into field "currentTitle"
  28.     end if
  29.     exit
  30.   end if
  31.   if (vCast > gButtonBase) and (vCast < gButtonLast) then
  32.     set vLine to vCast - gButtonBase
  33.     set vTitle to line vLine of field "titles"
  34.     set vTextNow to field "currentTitle"
  35.     if vTextNow <> vTitle then
  36.       put vTitle into field "currentTitle"
  37.     end if
  38.   else
  39.     set vText to field "currentTitle"
  40.     if vText <> EMPTY then
  41.       put EMPTY into field "currentTitle"
  42.     end if
  43.   end if
  44.   updateStage()
  45. end
  46.  
  47. on mouseDown
  48.   global gButtonBase, gTitleList, gSpriteBase, gGoingToTopic
  49.   set vCastNo to the mouseCast
  50.   set vName to the name of cast vCastNo
  51.   if (vName = "quitUp") or (vName = "currentTitle") or (vName = "MLOGO") or (vName = "mainBg") then
  52.     exit
  53.   end if
  54.   set vDisp to vCastNo - gButtonBase
  55.   set vSpriteNo to vDisp + gSpriteBase
  56.   set the castNum of sprite vSpriteNo to gButtonBase
  57.   updateStage()
  58.   set vOld to 0
  59.   repeat while the mouseDown
  60.     set vMcast to the mouseCast
  61.     if vMcast = gButtonBase then
  62.       nothing()
  63.     else
  64.       if vMcast = vCastNo then
  65.         set the castNum of sprite vSpriteNo to gButtonBase
  66.         updateStage()
  67.       else
  68.         set the castNum of sprite vSpriteNo to vCastNo
  69.         updateStage()
  70.       end if
  71.     end if
  72.     set vOld to vMcast
  73.   end repeat
  74.   set the castNum of sprite vSpriteNo to vCastNo
  75.   updateStage()
  76.   set vReleaseObj to the mouseCast
  77.   if vReleaseObj = vCastNo then
  78.     setDemo(vName, vDisp)
  79.     set gGoingToTopic to 1
  80.     set vGoto to vName & "main"
  81.     setPuppets(0)
  82.     go(vGoto)
  83.   end if
  84. end
  85.  
  86. on setDemo fTopic, fOffset
  87.   global gCurrentTopic, gTopicOffset, gTopicState
  88.   set gTopicState to "main"
  89.   set gCurrentTopic to fTopic
  90.   set gTopicOffset to fOffset
  91. end
  92.  
  93. on setCursors
  94.   global gHandCursor
  95.   repeat with i = 11 to 23
  96.     set the cursor of sprite i to gHandCursor
  97.   end repeat
  98.   set the cursor of sprite 3 to gHandCursor
  99.   set the cursor of sprite 5 to gHandCursor
  100. end
  101.